package test;
//属性：长（length）、宽（width）。
     //   ◦ 重写calculateArea()，公式为长*宽。*/
public class Rectangle {
    private double length;
    private double width;
    public  Rectangle(){}
    public  Rectangle(double length,double width){
        this.length = length;
        this.width = width;
    }
    public void setLength(double length){
        this.length = length;
    }
    public double getLength(){
        return length;
    }
    public void setWidth(double width){
        this.width = width;
    }
    public double getWidth(){
        return width;
    }
    public double calculateArea(){
        double area = length*width;
        return area;
    }
}
